/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author taha
 */
@Entity
@Table(name = "RESERVATION")
public class Reservation implements Serializable {

    private Long id;
    private Date debut;
    private Date fin;
    private Chambre chambre;

    public Reservation() {
    }

    public Reservation(Date debut, Date fin, Chambre chambre) {
        this.debut = debut;
        this.fin = fin;
        this.chambre = chambre;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "DEBUT")
    @Temporal(javax.persistence.TemporalType.DATE)
    public Date getDebut() {
        return debut;
    }

    public void setDebut(Date debut) {
        this.debut = debut;
    }

    @Column(name = "FIN")
    @Temporal(javax.persistence.TemporalType.DATE)
    public Date getFin() {
        return fin;
    }

    public void setFin(Date fin) {
        this.fin = fin;
    }

    @ManyToOne
    @JoinColumn(name = "CHAMBRE_ID")
    public Chambre getChambre() {
        return chambre;
    }

    public void setChambre(Chambre chambre) {
        this.chambre = chambre;
    }
}
